<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta charset="UTF-8">
	<title>CRM客户关系管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
 	<!-- <link rel="stylesheet" href="/gaoa/Public/css/global.css" media="all"> -->
	<!--<link rel="stylesheet" href="/gaoa/Public/plugins/font-awesome/css/font-awesome.min.css"> -->

	<link rel="stylesheet" href="/gaoa/Public/css/element-ui--index.css">


	<style>
	    *{
	    	font-family: microsoft YaHei;
	    }
		.pull-left {
			float: left;
		}
		.pull-right {
			float: right;
		}
		.container {
			padding: 2px;
		}
		.container > .wrapp >  .el-row {
			margin-bottom: 10px;
		}
		.el-form--inline .el-form-item {
			margin-bottom: 0px;
		}
/*		#app>.wrapp{
			display: none;
		}*/
		
		/*表格条纹样式*/
		.el-table .info-row {
		background: #ffffff;
		}

		.el-table .positive-row {
		background: #c9e5f5;
		}
		.cell img{
			vertical-align: middle;
		}
		
		.el-date-editor.el-input{
			width: 100%;
			max-width: 170px;
		}

		.el-table__body tr.current-row>td{
	      background: rgba(157, 195, 232, 0.7) !important;
	  }

    @media screen and (min-width:1165px) and (max-width:1200px){
      .el-dialog--small {
          width: 70%;
      }
    }

    @media only screen and (max-width:1164px){
      .el-dialog--small {
          width: 85%;
      }
    }  		
	</style>
	<!-- 如果没有 则 提供一些高级的js功能  -->
	<script src="/gaoa/Public/js/advancejs.js"></script>
	<!-- 不支持IE9 及以下的浏览器 -->
	<!--[if lte IE 9]> 
	<script>
		window.location.href="<?php echo U('login/notsupport');?>";
	</script>
	<![endif]-->
	
</head>
<body>
	
	
	<div id="app" class="container">
		<div class="wrapp" v-show="show" style="display:none">
			<el-row>
			  <el-col :span="12">
			    <el-form :inline="true" ref="searchForm" :model="searchForm">
			      <el-form-item prop="name">
			       <el-input placeholder="请输入标题关键字" v-model="searchForm.name"></el-input>
			      </el-form-item>
			      <el-form-item>
			       <el-button type="primary" icon="search" @click="dataReload">查询</el-button>
			       <el-tooltip content="清空搜索框并刷新表格数据" placement="right">
			        <el-button @click="searchReset" style="margin-left:10px;">重置</el-button>
			       </el-tooltip>
			      </el-form-item>
			    </el-form>
			  </el-col>

		  </el-row>
		  <el-row>
		    <el-col :span="24">
		      <el-table :data="dataList" border  v-loading="dataLoad" element-loading-text="<?php echo L('DATA_LOGIN');?>" ref="select" @selection-change="handleSelectionChange">
		        <el-table-column type="selection" align="center" width="50"></el-table-column>
		        <el-table-column label="序号" align="center" :formatter="handleIndex" width="65"></el-table-column>
		        <el-table-column label="标题" prop="title" align="center" ></el-table-column>
		        <el-table-column label="内容" prop="content" align="center" ></el-table-column>
		        <el-table-column label="发送时间" prop="time" align="center" ></el-table-column> 
		        <el-table-column label="操作人员" prop="from_id" align="center" >
				</el-table-column>
		      </el-table>
		    </el-col>
		  </el-row>

		  <el-row type="flex"  justify="space-between" align="middle"  class="row-bg">
            <el-col :span="12">
              <div class="grid-content bg-purple">
              	 <el-tooltip content="多选批量删除" placement="right">
              	   <el-button size="small" type="warning" icon="delete" @click="handleDeletes">批量删除
              	   </el-button>
              	 </el-tooltip>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="grid-content bg-purple-light pull-right">
		        <!-- page -->
		        <el-pagination
  @current-change="handleCurrentPageChange"
  :current-page="currentPage"
  layout="total, prev, pager, next, jumper"
  :total="total"
  :page-size="pageSize"
  ref="pagination"
  >
</el-pagination>
		        <!-- / page -->
              </div>
            </el-col>
		  </el-row>
		</div>
	</div>

	<script src="/gaoa/Public/js/vue.min.js"></script>
  <script src="/gaoa/Public/js/element-ui--index.js"></script>
	<script src="/gaoa/Public/js/vue-resource.min.js"></script>

	<!-- vue 通用部分  -->
	<script src="/gaoa/Public/js/vueHooks.js"></script>
	<script src="/gaoa/Public/js/vueMethods.js"></script>
	<script src="/gaoa/Public/js/vueOption.js"></script>
	<script src="/gaoa/Public/js/vueCommonLogic.js?b=d"></script>
	<script>
		var page = {
			addFormUrl:"<?php echo U('add');?>",
			editFormUrl:"<?php echo U('edit');?>",
			listUrl:"<?php echo U('getList');?>",
			deleteUrl:"<?php echo U('delete');?>",
			pageSize:<?php echo ($pageSize); ?>
		}
		window.defaultOption = new VueOption();

		// setCommonLogin 还可以再细分
		setCommonLogic(window.defaultOption);


	</script>

	<!-- / vue 通用部分  -->


	<script>
		
		
	</script>


	
<script>
  window.defaultOption.setDatas({
	  loadDataList:[],
  }).setForm('search',{
  	name:'',
  }).setMethod("handleDeletes", function(url){
	  if(this.multipleSelection.length <= 0){
		  this.$message.error('请先选择消息');
		  return false;
	  }else{
		  if (!arguments[2]) {
			  url= this.page.deleteUrl;
		  }
		  var selectedIds = new Array();
		  for(var i=0; i<this.multipleSelection.length; i++){
			  selectedIds[i] = this.multipleSelection[i].id;
		  }
		  var vmThis = this;
		  this.$confirm('确定删除?', '提示', {
			  confirmButtonText: '确定',
			  cancelButtonText: '取消',
			  type: 'warning'
		  }).then(function(){
			  vmThis.$http.post(url, {ids:selectedIds}).then(function(response){
				  vmThis.$message({
					  type: 'success',
					  message: '删除成功!'
				  });
				  vmThis.loadDatalist();
			  }, function(response){
				  vmThis.$message({
					  type: 'error',
					  message: '删除失败'
				  });
			  })
		  }).catch(function() {
			  vmThis.$message({
				  type: 'info',
				  message: '已取消删除'
			  });
		  });
	  }

  }).setMethod('handleSelectionChange',function(val){
	  this.multipleSelection = val;
  });
</script>

	<script>
	//改modal

		window.defaultVm = new Vue(window.defaultOption.getOption()).$mount('#app');
	</script>
</body>
</html>